Login
Connect to the broker, only once this function has returned successfully can any other operations be performed.
Request to be POSTed to uri : /NorenWClientTP/QuickAuth
Request Details :
Parameter Name | Possible value | Description |
---|---|---|
jData* | Should send json object with fields in below list |
Json Fields | Possible value | Description |
---|---|---|
apkversion* | Application version. | |
uid* | User Id of the login user | |
pwd* | Sha256 of the user entered password. | |
factor2* | DOB or PAN as entered by the user. (DOB should be in DD-MM-YYYY) | |
vc* | Vendor code provided by noren team, along with connection URLs | |
appkey* | Sha256 of uid | |
imei* | Send mac if users logs in for desktop, imei is from mobile | |
addldivinf | Optional field, Value must be in below format: | |
ipaddr | Optional field | |
source | API |
Example
- Python
- JavaScript
- Java
- dotNet
api = new Api({});
api.login(authparams)
.then((res) => {
console.log('Reply: ', res);
#credentials
user = <uid>
pwd = <password>
factor2 = <2nd factor>
vc = <vendor code>
app_key = <secret key>
imei = <imei>
ret = api.login(userid=uid, password=pwd, twoFA=factor2, vendor_code=vc, api_secret=app_key, imei=imei)
String response = api.login("MOBKUMAR", "Qwe@1234", "01-01-1970", "IDART_DESK", "12be8cef3b1758f5", "java-");
System.out.println(response);
static void Main(string[] args)
{
LoginMessage loginMessage = new LoginMessage();
loginMessage.apkversion = "1.0.0";
loginMessage.uid = uid;
loginMessage.pwd = pwd;
loginMessage.factor2 = factor2;
loginMessage.imei = imei;
loginMessage.vc = vc;
loginMessage.source = "API";
loginMessage.appkey = appkey;
BaseResponseHandler responseHandler = new BaseResponseHandler();
nApi.SendLogin(responseHandler.OnResponse, endPoint, loginMessage);
responseHandler.ResponseEvent.WaitOne();
LoginResponse loginResponse = responseHandler.baseResponse as LoginResponse;
Console.WriteLine("app handler :" + responseHandler.baseResponse.toJson());
Console.ReadLine();
}
Response Details :
Json Fields | Possible value | Description |
---|---|---|
stat | Ok or Not_Ok | Login Success Or failure status |
susertoken | It will be present only on login success. This data to be sent in subsequent requests in jKey field and web socket connection while connecting. | |
lastaccesstime | It will be present only on login success. | |
spasswordreset | Y [If emsg is “Password Expired” or “Change Password” and stat is Not_Ok ] | If Y Mandatory password reset to be enforced. Otherwise the field will be absent. |
exarr | Json array of strings with enabled exchange names | |
uname | User name | |
prarr | Json array of Product Obj with enabled products, as defined below. | |
actid | Account id | |
Email Id | ||
brkname | Broker id | |
emsg | This will be present only if Login fails. |
Sample Success Response :
{
"request_time": "20:18:47 19-05-2020",
"stat": "Ok",
"susertoken": "3b97f4c67762259a9ded6dbd7bfafe2787e662b3870422ddd343a59895f423a0",
"lastaccesstime": "1589899727"
}
Sample Failure Response :
{
"request_time": "20:32:14 19-05-2020",
"stat": "Not_Ok",
"emsg": "Invalid Input : Wrong Password"
}